package com.stronger.pettern.builder;

import cn.hutool.log.Log;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

@Data
@AllArgsConstructor
public class PersonBuilder {
    private Person person;
    public PersonBuilder(){
        person=new Person();
    }
    public PersonBuilder setAge(int age){
        person.age = age;
        return this;
    }

    public PersonBuilder setName(String name){
        person.name = name;
        return this;
    }

    public PersonBuilder setSex(String sex){
        person.sex = sex;
        return this;
    }

    public PersonBuilder setAddress(String address){
        person.address = address;
        return this;
    }

    public PersonBuilder setBorn(String born){
        person.born = born;
        return this;
    }

    public Person create(){
        return person;
    }
}
